package com.binfenhulian.chinaenergy.ces.utils.file;

/**
 * Created by wanghjbuf on 2018/3/19.
 */
public class FileUtils {

    /**
     * 通过路径获取文件名称
     * @param path
     * @return
     * @throws Exception
     */
    public static String getFileNameByPath(String path) throws Exception{
        String[] dirctorys = path.split("/");
        if (dirctorys.length > 0){
            return dirctorys[dirctorys.length -1];
        } else {
            throw new Exception("无效的路径,操作失败!");
        }
    }
}
